//push events on a stack
//will automatically be reportet to whatever is set in the options
/*Looks up for following Options
	event_stack_length: number of events before sending them to server
*/
(function (that) {

	//local Link to Global-Object or throw Exception
	if(!that){throw "Global object missing, bitchesss";}

	var calc_additional_size = function(browser_size){
		if(browser_size > that.options.canvas){
			var overlength = browser_size - that.options.canvas;
			return Math.round(overlength/2);
		}
		return 0;
	};

	that.calc_browser_sizes = function(){
		that.browser_width		= window.innerWidth  // normal browsers
								|| document.documentElement.clientWidth // not so normal browsers
								|| window.document.body.clientWidth; // not so normal browsers having their period

		that.browser_height 	= window.innerHeight // normal browsers
								|| document.documentElement.clientHeight // not so normal browsers
								|| window.document.body.clientHeight; // not so normal browsers having their period

		that.browser_top		= window.pageYOffset // normal browsers
								|| document.documentElement.scrollTop // not so normal browsers
								|| window.document.body.scrollTop; // not so normal browsers having their period

		var new_y_offset		= that.browser_height + that.browser_top;
		if(new_y_offset > options.max_y_offset){
			options.max_y_offset = new_y_offset;
		}

		that.additional_layout_width = calc_additional_size(that.browser_width); //needed for x normalization -> normalizer.js check for pageX recalculation
	};


})(sauberfant);
